package com.ruoyi.salesInvoice.mapper;

import com.ruoyi.expressdelivery.domain.ExpressDelivery;
import com.ruoyi.salesInvoice.domain.SalesInvoiceModel;
import com.ruoyi.salesInvoice.domain.SalesInvoiceOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SalesInvoiceMapper {
    /**
     * 查询销售发票订单列表
     *
     * @param salesInvoiceOrder 查询条件
     * @return 结果
     */
    List<SalesInvoiceOrder> selectSalesInvoice(SalesInvoiceOrder salesInvoiceOrder);

    public int auditSale(SalesInvoiceOrder salesInvoiceOrder);

    public List<ExpressDelivery> selectSfInformation(String saleordernum);

    /**
     * 查询销售发票信息
     *
     * @param map 查询条件
     * @return 结果
     */
    List<SalesInvoiceOrder> selectSalesInvoiceByMap(Map<String, Object> map);


    List<SalesInvoiceOrder> selectinformation(String salesInvoiceNum);

    /**
     * 插入销售发票信息
     *
     * @param salesInvoiceOrder 插入数据
     * @return 结果
     */
    int insertSalesInvoiceOrder(SalesInvoiceOrder salesInvoiceOrder);

    int insertfp(SalesInvoiceOrder salesInvoiceOrder);

    void editfp(@Param("phone") String phone, @Param("fname") String fname, @Param("shdz") String shdz, @Param("companyId") String companyId, @Param("salesInvoiceNum") String salesInvoiceNum, @Param("phone") String remarks);


    /**
     * 插入销售发票子表信息
     *
     * @param salesInvoiceModelList 插入子表数据
     * @return 结果
     */
    int insertSalesInvoiceModelList(List<SalesInvoiceModel> salesInvoiceModelList);

    /**
     * 插入销售发票子表信息
     *
     * @param salesInvoiceOrder 插入子表数据
     * @return 结果
     */
    int insertSalesInvoiceModelByOrder(SalesInvoiceOrder salesInvoiceOrder);

    /**
     * 查询销售发票信息
     *
     * @param salesInvoiceId 查询条件
     * @return 结果
     */
    SalesInvoiceOrder selectSalesInvoiceOrderById(Long salesInvoiceId);

    /**
     * 修改销售发票信息
     *
     * @param salesInvoiceOrder 需要修改的数据
     * @return 结果
     */
    int updateSalesInvoiceOrder(SalesInvoiceOrder salesInvoiceOrder);

    /**
     * 修改销售发票子表的信息
     *
     * @param salesInvoiceModelList 子表需要修改的数据
     * @return 结果
     */
    int updateSalesInvoiceModel(SalesInvoiceModel salesInvoiceModelList);

    /**
     * 修改销售发票子表的信息
     *
     * @param salesInvoiceModelList 子表需要修改的数据集合
     * @return 结果
     */
    int updateSalesInvoiceModelList(@Param("list") List<SalesInvoiceModel> salesInvoiceModelList);

    /**
     * 通过销售发票主键查询销售发票子表的数据
     *
     * @param salesInvoiceId 销售发票主表主键
     * @return 结果
     */
    List<SalesInvoiceModel> selectSalesInvoiceModelByOrderId(Long salesInvoiceId);

    /**
     * 删除销售发票子表数据
     *
     * @param salesInvoiceNoList 需要删除的数据集合
     */
    void deleteSalesInvoiceModelList(List<Long> salesInvoiceNoList);

    /**
     * 删除销售发票主表信息
     *
     * @param salesInvoiceId 销售发票主表id
     * @return 结果
     */
    int deleteSalesInvoiceOrderById(Long salesInvoiceId);

    /**
     * 查询销售发票子表数据信息
     *
     * @param aLong 销售发票子表主键集合
     * @return 结果
     */
    List<SalesInvoiceModel> selectSalesInvoiceModelByModelsIdList(@Param("list") List<Long> aLong);

    /**
     * 查询销售发票子表数据信息
     *
     * @param salesInvoiceNo 销售发票子表
     * @return 结果
     */
    SalesInvoiceModel selectSalesInvoiceModelById(Long salesInvoiceNo);

    SalesInvoiceModel selectInvoiceByIds(SalesInvoiceModel salesInvoiceModel);

    Long querypreviousId(Map<String, Object> params);
    Long queryNextId(Map<String, Object> params);

    List<Map<String, Object>> pendingReview(@Param("deptID") Long deptID);
}
